package com.testgmaillike.activity;

import java.util.ArrayList;
import java.util.List;

import com.learnNcode.gmaillikeloading.CustomView;
import com.learnNcode.gmaillikeloading.IActionBarReset;
import com.learnNcode.gmaillikeloading.IRefreshListner;
import com.testgmaillike.BaseActivity;
import com.testgmaillike.R;
import com.testgmaillike.R.layout;
import com.testgmaillike.adapter.ItemAdapter;
import com.testgmaillike.callback.RefreshCallback;

import android.os.Bundle;
import android.app.ActionBar;
import android.app.Activity;
import android.view.Menu;

public class TestMainActivity extends BaseActivity {

	private List<Integer> list = new ArrayList<Integer>();
	private ItemAdapter adapter;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		
		init(getApplicationContext());
		
		for (int i = 0; i < 10; i++) {
			list.add(i);
		}
		
		adapter = new ItemAdapter(getApplicationContext(), list);
		setAdapter(adapter);
		mCallback = new RefreshCallback() {
			
			@Override
			public void before() {
				for (int i = 10; i < 20; i++) {
					list.add(i);
				}
				adapter.notifyDataSetChanged();
			}
			
			@Override
			public void after() {
				// TODO Auto-generated method stub
				
			}
		};
	}
}
